#ifndef _drv_spi_init_h
#define _drv_spi_init_h

#include "n32g430.h"

#define SPI_W25                 SPI2
#define SPI_W25_PERIPH          RCC_APB2_PERIPH_SPI2
#define SPI_W25_PERIPH_GPIO     RCC_AHB_PERIPH_GPIOB
#define SPI_W25_GPIO            GPIOB
#define SPI_W25_GPIO_ALTERNATE  GPIO_AF1_SPI2
#define SPI_W25_MISO_PIN        GPIO_PIN_14
#define SPI_W25_MOSI_PIN        GPIO_PIN_15
#define SPI_W25_CLK_PIN         GPIO_PIN_13
#define SPI_W25_NSS_PIN         GPIO_PIN_12


void DPM_SpiInit(void);
void DPM_SpiW25Cs_0(void);
void DPM_SpiW25Cs_1(void);
void DPM_SpiW25Transimit(uint8_t byte);
uint16_t DPM_SpiW25Read(void);

#endif

